"""
@author: lyf
@file: 圣诞送礼.py
@time: 2022/11/5 17:34
"""
import random
sc = "ABCDEFGHIJK"
result = {}
song = list(sc)
shou = list(sc)
count = 0
while song:
    i = random.randint(0, len(sc) - 1)
    j = random.randint(0, len(sc) - 1)
    if sc[i] in song and sc[j] in shou and i != j:
        a = sc[i]
        b = sc[j]
        result.update({a:b})
        print(f"同学{sc[i]}送了同学{sc[j]}一份礼物")
        song.remove(sc[i])
        shou.remove(sc[j])
        count = count + 1
        if count < len(sc):
            continue
print(result)